import React, {Component} from 'react';
import {withRouter} from 'dva/router'

export default class Center extends Component {
  render() {
    return (
      <div>
        center
        <WithChild/>
        {/*<Child/>*/}
      </div>
    );
  }
}

class Child extends Component {
  render() {
    return (
      <div>
        <button onClick={() => {
          console.log(this.props)
          this.props.history.push('/login')
          localStorage.clear()
        }}>退出登录</button>
      </div>
    );
  }
}

const WithChild = withRouter(Child)
